package net.kodra.gwt.crx.demo.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ResizeComposite;
import com.google.gwt.user.client.ui.Widget;

public class PopupWidget extends ResizeComposite
{

  private static PopupWidgetUiBinder uiBinder = GWT.create(PopupWidgetUiBinder.class);

  interface PopupWidgetUiBinder extends UiBinder<Widget, PopupWidget>
  {
  }

  @UiField Button button;

  public PopupWidget()
  {
    initWidget(uiBinder.createAndBindUi(this));
    button.setText("Jupi!!!");
  }

  @UiHandler("button")
  void onClick(ClickEvent e)
  {
    Window.alert("Hello!");
  }

  @Override
  public void onResize()
  {
    Window.alert(this.getClass().getName() + ".onResize(): ...");

  }

}